#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QLabel>
#include "TabviewPinAssignment.h"
#include "ListviewPinAssignment.h"
#include "PinAssignment.h"

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

  public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

  private slots:

    void PinTriggered(void* v,int Index,bool checked);
    void FunctionClicked(void* v);
    void PinFunctionChange(int PinIndex,PinAssignment::PinStatus Status);

    void on_lineEdit_Search_textChanged(const QString& arg1);
    void on_spinBox_GridWidth_valueChanged(int arg1);
    void on_spinBox_GridHeight_valueChanged(int arg1);

    void on_actionOpenAssignmentFile_triggered();
    void on_actionNewAssignmentFile_triggered();
    void on_actionSaveAssignmentFile_triggered();

  private:
    Ui::MainWindow *ui;

    PinAssignment* pa;
    QList<TabviewPinAssignment::Pin*> pins;
    QList<ListviewPinAssignment::Function*> functions;

    void ClearPinFunction();

};
#endif // MAINWINDOW_H
